package com.team2.outpatient_sys.pojo;

import java.util.ArrayList;
import java.util.List;

/**
 * 挂号信息 实体类
 */
public class Registered {
    // 挂号id
    private Integer id;
    // 病人id
    private Integer patientId;
    // 医生id
    private Integer doctorId;
    // 用户id
    private Integer userId;
    // 科室id
    private Integer deptId;
    // 就诊序号
    private Integer serialNumber;
    // 挂号状态(1代表以挂号，2代表待就诊，3代表已完成，4代表已取消)
    private Integer status;
    // 就诊时段(1代表8点到9点，2代表9点到10点，3代表10点到11点，4代表11点到12点，5代表13点到14点，6代表14点到15点，7代表15点到16点，8代表16点到17点)
    private Integer timeQuantum;
    // 挂号时间
    private String regTime;
    //就诊时间
    private String clinicTime;

    private List<Integer> timeQuantumList;

    public Registered() {
    }

    public Registered(Integer id, Integer patientId, Integer doctorId, Integer userId, Integer deptId, Integer serialNumber, Integer status, Integer timeQuantum, String regTime, String clinicTime) {

        this.id = id;
        this.patientId = patientId;
        this.doctorId = doctorId;
        this.userId = userId;
        this.deptId = deptId;
        this.serialNumber = serialNumber;
        this.status = status;
        this.timeQuantum = timeQuantum;
        this.regTime = regTime;
        this.clinicTime = clinicTime;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getPatientId() {
        return patientId;
    }

    public void setPatientId(Integer patientId) {
        this.patientId = patientId;
    }

    public Integer getDoctorId() {
        return doctorId;
    }

    public void setDoctorId(Integer doctorId) {
        this.doctorId = doctorId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getDeptId() {
        return deptId;
    }

    public void setDeptId(Integer deptId) {
        this.deptId = deptId;
    }

    public Integer getSerialNumber() {
        return serialNumber;
    }

    public void setSerialNumber(Integer serialNumber) {
        this.serialNumber = serialNumber;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getTimeQuantum() {
        return timeQuantum;
    }

    public void setTimeQuantum(Integer timeQuantum) {
        this.timeQuantum = timeQuantum;
    }

    public String getRegTime() {
        return regTime;
    }

    public void setRegTime(String regTime) {
        this.regTime = regTime;
    }

    public String getClinicTime() {
        return clinicTime;
    }

    public void setClinicTime(String clinicTime) {
        this.clinicTime = clinicTime;
    }

    @Override
    public String toString() {
        return "Registered{" +
                "id=" + id +
                ", patientId=" + patientId +
                ", doctorId=" + doctorId +
                ", userId=" + userId +
                ", deptId=" + deptId +
                ", serialNumber=" + serialNumber +
                ", status=" + status +
                ", timeQuantum=" + timeQuantum +
                ", regTime='" + regTime + '\'' +
                ", clinicTime='" + clinicTime + '\'' +
                '}';
    }

    public List<Integer> getTimeQuantumList() {
        timeQuantumList = new ArrayList<>();
        if(timeQuantum==1){
            timeQuantumList.add(8);
            timeQuantumList.add(9);
        }else if(timeQuantum==2){
            timeQuantumList.add(9);
            timeQuantumList.add(10);
        }else if(timeQuantum==3){
            timeQuantumList.add(10);
            timeQuantumList.add(11);
        }else if(timeQuantum==4){
            timeQuantumList.add(11);
            timeQuantumList.add(12);
        }
        else if(timeQuantum==5){
            timeQuantumList.add(13);
            timeQuantumList.add(14);
        }else if(timeQuantum==6){
            timeQuantumList.add(14);
            timeQuantumList.add(15);
        }else if(timeQuantum==7){
            timeQuantumList.add(15);
            timeQuantumList.add(16);
        }else if(timeQuantum==8){
            timeQuantumList.add(16);
            timeQuantumList.add(17);
        }
        return timeQuantumList;
    }

    public void setTimeQuantumList(List<Integer> timeQuantumList) {
        this.timeQuantumList = timeQuantumList;
    }
}
